<template>
  <div class="add-user">
    <Card 
      @reset="resetInfo"
      api="/identity/edit" 
      :prop="{ ...info }" 
      title="添加身份">
      <el-input v-model="info.identity_text" placeholder="请输入身份名称" />
    </Card>

    <Card
      @reset="resetInfo"
      api="/user/authorityApi/edit"
      :prop="{ ...info }"
      title="添加api接口权限"
    >
      <el-input
        v-model="info.api_authority_text"
        placeholder="请输入api接口权限名称"
      />
      <el-input
        v-model="info.api_authority_url"
        placeholder="请输入api接口权限url"
      />
      <el-input
        v-model="info.api_authority_method"
        placeholder="请输入api接口权限方法"
      />
      <!-- api_authority_text: 免税店
api_authority_url: ljlksd
api_authority_method: fn -->
    </Card>
  </div>
</template>

<script>
import Com from "./components/Com.vue";
import Card from "./components/Card.vue";
export default {
  components: {
    Com,
    Card,
  },
  data() {
    return {
      info: {
        identity_text: "",
        api_authority_text: "",
        api_authority_url: "",
        api_authority_method: "",
      }
    };
  },
  methods: {
    resetInfo(info) {
      this.info = info
    }
  }
};
</script>

<style>
.add-user {
  display: flex;
  flex-wrap: wrap;
}
.add-user > div {
  width: 33%;
}
</style>